<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <ul>
      <li>111</li>
      <li>222</li>
      <li>333</li>
      <li>444</li>
    </ul>
    <script>
      var li = document.querySelectorAll("li");
      li.forEach(function (item) {
        item.onclick = function () {
          setTimeout(function () {
            item.style.color = "red";
          }, 500);
        };
      });
    </script>
  </body>
</html>
